{{ define "pagecss" }}

{{ end }}

{{ define "content" }}
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-header">
            <span>编辑管理员</span>
        </div>
        <div class="layui-card-body" style="padding: 15px;">
            <form class="layui-form" action="" lay-filter="component-form-group">
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>是否启用</label>
                    <div class="layui-input-block">
                        <input type="checkbox" name="status" {{ if eq 1 $.info.Status }} checked="" {{ end }} lay-skin="switch" lay-text="启用|禁用"><div class="layui-unselect layui-form-switch" lay-skin="_switch"><em>启用</em><i></i></div>
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>用户名</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input username" name="username" data-username="{{ $.info.Username }}" value="{{ $.info.Username }}" maxlength="12" lay-verify="required" placeholder="请输入" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>登录邮箱</label>
                    <div class="layui-input-block">
                        <input type="text" class="layui-input" name="email" value="{{ $.info.Email }}" maxlength="60" lay-verify="required" placeholder="请输入" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>登录密码</label>
                    <div class="layui-input-block">
                        <input type="password" class="layui-input password" name="password" value="" lay-verify="password" placeholder="不填，则不修改" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>确认密码</label>
                    <div class="layui-input-block">
                        <input type="password" class="layui-input confirm_password" name="confirm_password" value="" lay-verify="confirm_password" placeholder="请输入密码" autocomplete="off">
                    </div>
                </div>
                <div class="layui-form-item">
                    <label class="layui-form-label"><span class="required">*</span>角色</label>
                    <div class="layui-input-block">
                        {{ range $adminRole := $.adminRoles }}
                            <input type="checkbox" class="role_ids" name="role_ids[]" value="{{ $adminRole.Id }}" {{ if eq $adminRole.Id $.info.Status }} checked="" {{ end }} lay-skin="primary" title="{{ $adminRole.Name }}">
                            <div class="layui-unselect layui-form-checkbox" lay-skin="primary">
                                <span>{{ $adminRole.Name }}</span><i class="layui-icon layui-icon-ok"></i>
                            </div>
                        {{ end }}
                    </div>
                </div>

                <input type="hidden" name="id" value="{{ $.info.Id }}">

                <div class="layui-form-item layui-layout-admin">
                    <div class="layui-input-block">
                        <div class="layui-footer" style="left: 0;">
                            <button type="button" class="layui-btn layui-btn-primary close-btn">取消</button>
                            <button type="button" class="layui-btn" lay-submit="" lay-filter="laySave">保存 <i class="layui-icon layui-icon-release"></i></button>
                        </div>
                    </div>
                </div>
            </form>
        </div>
    </div>
</div>

<input type="hidden" class="check_username_url" value="admin/{{ $.model }}/checkloginname">
<input type="hidden" class="save_url" value="admin/{{ $.model }}/savepost">
{{ end }}

{{ define "pagescript" }}
<script src="/static/admin/pages/js/admin.js" type="text/javascript"></script>
{{ end }}